package com.hmkj.core.mapper.user;

import com.hmkj.common.baseMapper.GenericMapper;
import com.hmkj.core.model.user.UserBankModel;
import com.hmkj.core.po.user.UserBank;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 用户绑卡记录相关Dao接口<br>
 *
 * @author donfy
 * @date   2017-08-25 04:51:01
 */
public interface UserBankMapper extends GenericMapper<UserBank,Integer> {

    @Select("SELECT t.*,u.user_name AS 'u.userName',u.mobile AS 'u.mobile' FROM biz_user_bank t LEFT JOIN biz_user u ON u.id = t.user_id  WHERE 1=1 ${whereSql} ${sortSql} limit ${nowPage}, ${pageSize} ")
    List<UserBankModel> findListBySqlJoin(Map<String, Object> params);

    @Select("SELECT count(1)  FROM biz_user_bank t LEFT JOIN biz_user u  ON u.id = t.user_id  WHERE 1=1 ${whereSql}")
    long countBySqlJoin(Map<String, Object> params);
}
